<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="description" content="" />
		<meta name="keywords" content="" />
		<meta name="author" content="Flying hormone" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta charset="UTF-8">
		<link rel="stylesheet" href="../css/media.css" />
		<link rel="stylesheet" href="../css/mui.min.css" />
        <link rel="stylesheet" href="../css/head_foot.css" />
        <script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="../js/jquery.Query.js" ></script>
        <script type="text/javascript" src="../js/jquery-cookie.js"></script>
        <script type="text/javascript" src="../js/mui.min.js"></script>
        <script type="text/javascript" src="../js/appcan.js"></script>
        <script type="text/javascript" src="../js/appcan.control.js"></script>
        <script type="text/javascript" src="../js/common.js" ></script>
		<title>项目名称</title>
		<style>
			
			.shucailei {
				margin-top: 0.625em;
				background: #fff;
			}
			
			.shucailei h2 {
				background: #fff;
				color: #666;
				padding: 0.5em 4%;
				font-size: 1em;
				line-height: 1.2em;
				position: relative;
				border-bottom: 1px solid #ccc;
			}
			
			.shucailei h2 span {
				float: right;
			}
			
			.shucailei>p {
				background: #f9efc9;
				text-align: center;
				position: relative;
				line-height: 1.825em;
			}
			
			.shucailei>p a {
				position: absolute;
				right: 0.3125em;
				color: #ff5256;
			}
			
			.shucailei .i {
				font-style: normal;
				color: #ff3366;
				margin-right: 0.625em;
			}
			
			
			
		</style>
	</head>

	<body>
		<header>
			<a><span class="leftleft"></span></a>
			<h1>活动商品列表</h1>
			<a class="xiaoxi2" cardId=''>名片</a>
		</header>
		<section class="shucailei" id="goodsList">
		</section>
		<script>
		    var actId = getVal("actId");
		    var cateId = getVal("cateId");
            $(function(){
                appcan.ready(function(){
                    appcan.window.setBounce({
                        bounceType:0,
                        startPullCall:function(type){
                        },
                        downEndCall:function(type){
                            window.location.reload();
                        },
                        upEndCall:function(type){
                            appcan.window.resetBounceView(type);
                        },
                        color:"#fff"
                    })
                })
                appcan.ajax({
                    type:"post",
                    url:host+"/getActItem.json?actId="+actId+"&cateId="+cateId+"&limit=-1",
                    data:'',
                    dataType:"json",
                    contentType: "application/json",
                    success : function(dataResult) {
                        var dataList = dataResult.data;
                        var itemStr = "";
                        if(dataList.length>0){
                            $(".xiaoxi2").attr("cardId", dataList[0].active.cardId);
                            for(var i=0;i<dataList.length;i++){
                                var itemList = dataList[i].itemList;
                                itemStr +='<h2>'+dataList[i].cateName+'</h2>';
                                itemStr +='<div><ul class="list_c">'
                                for(var j=0;j<itemList.length;j++){
                                    var yourtime=itemList[j].endTime+" 23:59:59";
                                    yourtime = yourtime.replace("-","/");//替换字符，变成标准格式
                                    var d2=new Date();//取今天的日期
                                    var d1 = new Date(Date.parse(yourtime));
                                    // 未结束 未下架的
                                   if(d1>=d2 && (itemList[j].updateBy.length == 0 || itemList[j].updateBy == "0")){
                                        itemStr +='<li>';
                                        itemStr +='<a href="javascript:;">';
                                        itemStr +='<div>';
                                        itemStr +='<img src="'+hostIp+itemList[j].itemPic+'">';
                                        itemStr +='</div>';
                                        itemStr +='<div>';
                                        itemStr +='<h3>品名：'+itemList[j].itemName+'</h3>';
                                        itemStr +='<p><span class="i">特价：'+itemList[j].spePrice+'元/'+itemList[j].speUnit+'</span>原价：<s>'+itemList[j].listPrice+'元/'+itemList[j].listUnit+'</s></p>';
                                        itemStr +='<p>时间：'+itemList[j].startTime+' 至 '+itemList[j].endTime+'</p>';
                                        itemStr +='<p>说明：'+itemList[j].remark+'</p>';
                                        itemStr +='</div>';
                                        itemStr +='</a>';
                                        itemStr +='</li>';
                                    }
                                }
                                itemStr +='</ul></div>';
                            }
                        }
                        $("#goodsList").html(itemStr);
                    }
                })
            });
		</script>
	</body>
</html>